#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main()
{
    int fd = open("myfiel", O_RDONLY);
    if(fd < 0){
        perror("open");
        return 1;
    } 
    const char* msg = "this isn't a file\n";
    char buff[1024];
    int len = strlen(msg);
    while(1){
        ssize_t s = read(fd, buff, len);
        if(s > 0){
            printf("%s",buff);
        }else{
            break;
        }
    }
    return 0;
}